import React, {Component} from 'react'
import {Modal, Button} from 'antd'

/**
 * 详情弹出框
 */
class DetailModal extends Component {

    handleOk = () => {
        // console.log('handleOk')
        setTimeout(() => {
            this.props.onClose();
        }, 3000);
    }
    handleCancel = () => {
        this.props.onClose();
    }

    render() {
        // console.log('modalData', this.props.modalData)
        return(
            <Modal
                visible={this.props.visible}
                title={this.props.title}
                onOk={this.handleOk}
                onCancel={this.handleCancel}
                footer={[
                <Button key="back" onClick={this.handleCancel}>Return</Button>,
                // <Button key="submit" type="primary" loading={loading} onClick={this.handleOk}>
                //     Submit
                // </Button>,
                ]}
            >
                <p>Row:{JSON.stringify(this.props.modalData.row)}</p>
                <p>text:{JSON.stringify(this.props.modalData.text)}</p>
                <p>index:{this.props.modalData.index}</p>
            </Modal>
        );
    }
}

export default DetailModal;